package com.travel.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 机票订单表
 * @TableName flight_tickets_order
 */
@TableName(value ="flight_tickets_order")
@Data
public class FlightTicketsOrder implements Serializable {
    /**
     * 机票订单id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 航班id
     */
    @TableField(value = "flight_id")
    private Integer flightId;

    /**
     * 出行人姓名
     */
    @TableField(value = "traveler_name")
    private String travelerName;

    /**
     * 出行人身份证号
     */
    @TableField(value = "traveler_id_number")
    private String travelerIdNumber;

    /**
     * 出行人手机号
     */
    @TableField(value = "phoneNumber")
    private String phonenumber;

    /**
     * 机票评分
     */
    @TableField(value = "score")
    private Double score;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        FlightTicketsOrder other = (FlightTicketsOrder) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getFlightId() == null ? other.getFlightId() == null : this.getFlightId().equals(other.getFlightId()))
            && (this.getTravelerName() == null ? other.getTravelerName() == null : this.getTravelerName().equals(other.getTravelerName()))
            && (this.getTravelerIdNumber() == null ? other.getTravelerIdNumber() == null : this.getTravelerIdNumber().equals(other.getTravelerIdNumber()))
            && (this.getPhonenumber() == null ? other.getPhonenumber() == null : this.getPhonenumber().equals(other.getPhonenumber()))
            && (this.getScore() == null ? other.getScore() == null : this.getScore().equals(other.getScore()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getFlightId() == null) ? 0 : getFlightId().hashCode());
        result = prime * result + ((getTravelerName() == null) ? 0 : getTravelerName().hashCode());
        result = prime * result + ((getTravelerIdNumber() == null) ? 0 : getTravelerIdNumber().hashCode());
        result = prime * result + ((getPhonenumber() == null) ? 0 : getPhonenumber().hashCode());
        result = prime * result + ((getScore() == null) ? 0 : getScore().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", flightId=").append(flightId);
        sb.append(", travelerName=").append(travelerName);
        sb.append(", travelerIdNumber=").append(travelerIdNumber);
        sb.append(", phonenumber=").append(phonenumber);
        sb.append(", score=").append(score);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}